﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CH.Easy.DbProvider.Common;
using System.Data.Common;
using System.Linq.Expressions;
using CH.Easy.DbProvider.ExpressionExtend;

namespace CH.Easy.DbProvider.Entity
{
    public class SolutionResult
    {
        public string CmdText { get; set; }
        public Expression Expression { get; set; }
        public DbParameter[] Parameter { get; set; }
        public ExecuteType ExecuteType { get; set; }
        public LambdaExpression ResultExpression { get; set; }
        public Type ResultType { get; set; }
        public int PageIndex { get; set; }
        public int PageSize { get; set; }
        public bool IsPage
        {
            get
            {
                if (this.Expression != null)
                {
                    SelectExpression se = this.Expression as SelectExpression;
                    if (se != null)
                    {
                        this.PageIndex = se.PageIndex;
                        this.PageSize = se.PageSize;
                        return se.IsPage;
                    }
                    else 
                    {
                        return false;
                    }
                }
                else 
                {
                    return false;
                }

            }

        }
        public SolutionResult CountSolutionResult { get; set; }
        public SolutionResult() 
        {
       
        }
    }
}
